package com.woniu.server;

import lombok.Data;

@Data
public class RedisKey {

    public static String userRepairNum(String userId){
        return "user:"+userId+":repairNum";
    }

    public static String noticeView(String noticeId){
        return "notice:"+noticeId+":view";
    }
    //添加订单接口实现幂等性处理
    public static String addOrder(String userId){
        return "add:order:"+userId;
    }
    // 购物车集合（可查出每个用户的购物车对应店铺id）
    public static String shoppingCarts(String userId){
        return "shoppingCarts:"+"userId:"+userId;
    }
    //购物车详情（可查出每个用户的购物车对应店铺id下的所有商品详情）
    public static String shoppingCart(String userId,String storeId){
        return "shoppingCart:"+"userId:"+userId+":"+"storeId:"+storeId;
    }
    // 存取上传评论文件照片的网络路径
    public static String saveUploadCommentPic(Long userId){
        return "save:Upload:CommentPic:"+userId;
    }
    // 存取店铺评分
    public static String saveStoreScore(){
        return "save:StoreScore";
    }
    // 存取hash的外部商铺id
    public static String saveStoreId(String storeId){
        return "save:StoreId:" + storeId;
    }
    // 存取每日订单量
    public static String saveDailyCount() {
        return "save:daily:count";
    }
    // 存取店铺日营业额
    public static String saveStoreMoney() {
        return "save:store:money";
    }
    //申请列表
    public static String applyList(){
        return "apply:list";
    }
    // 申请店铺
    public static String applyForStore(String userId){
        return "apply:store:"+userId;
    }
    // 超时未处理申请
    public static String applyTimeOutList(){
        return "apply:timeOut:";
    }
    public static String applyTimeOut(String userId){
        return "apply:timeOut:"+userId;
    }
    /**
     * Key规范:sendregcodeinhour:phone:手机号
     */
    public static String getSendRegCodeInHourKey(String phone) throws Exception {
        return "sendregcodeinhour:phone:" + phone;
    }


    public static String getSendRegCodeByOneMin(String phone) throws Exception {
        return "SendRegCodeByOneMin:phone:" + phone;
    }

    public static String getSendRegCodeByRegist(String phone) throws Exception {
        return "SendRegCodeByRegist:phone:" + phone;
    }

    public static String getSendRegCodeBySum(String phone) throws Exception {
        return "SendRegCodeBySum:phone:" + phone;
    }

    public static String getSendRegCodeByRegistSum(String phone) throws Exception {
        return "SendRegCode:Register:Sum:phone:" + phone;
    }

    /**
     * Key规范:sendregcode:phone:手机号
     */
    public static String getSendRegCodeKey(String phone) throws Exception {
        return "sendregcode:phone:" + phone;
    }

    /**
     * Key规范:sendregcodeinmin:phone:手机号
     */
    public static String getSendRegCodeInMinKey(String phone) throws Exception {
        return "sendregcodeinmin:phone:" + phone;
    }
    public static String userPermission(Integer userId){
        return "user:permission:userid:"+userId;
    }
    public static String userResource(Integer userId){
        return "user:resource:userid:"+userId;
    }
    public static String adminPermission(Integer adminId){
        return "admin:permission:adminid:"+adminId;
    }
    public static String adminResource(Integer adminId){
        return "admin:resource:adminid:"+adminId;
    }
    //存取店铺最受欢迎的餐品
    public static String saveStorePopularFood(String storeId){
        return "save:store:popular:food:"+storeId;
    }
    //是否存在该key判断是否清空受欢迎的餐品
    public static String isExistStorePopularFood(String storeId,String date){
        return "is:exist:store:popular:food:"+storeId+":"+date;
    }
}
